Description
Release 1. The biggest gap and a data-loss safety net (select-all+type or Ctrl+U is currently unrecoverable). Add an undo stack in internal/editor capturing buffer+cursor snapshots (or reversible ops). Coalesce consecutive typing into one undo group; each structural op (newline, delete, paste, cut, delete-selection, kill-line, word-delete) is its own group. Bound history (e.g. 500 entries). Keys: Ctrl+Z undo, Ctrl+Y (and Ctrl+Shift+Z) redo. Restore cursor + scroll on undo/redo. Mark Dirty appropriately.
Acceptance Criteria
- #1 Ctrl+Z reverts the last edit group; Ctrl+Y / Ctrl+Shift+Z redoes
- #2 Typing is coalesced; structural ops are separate groups
- #3 Cursor and selection state restored on undo/redo
- #4 Redo stack cleared on a new edit; history bounded